Diffusion in biological media: a comprehensive numerical-analytical study via surface analysis and diffusivities calculation

The study of diffusion in biological materials is crucial for fields like food science, engineering, and pharmaceuticals. Research that combines numerical and analytical methods is needed to better understand diffusive phenomena across various dimensions and under variable boundary conditions within food matrices. This study aims to bridge this gap by examining the diffusion of substances through biological materials analytically and numerically, calculating diffusivity and conducting surface analysis. The research proposes a process for sweetening Bing-type cherries (Prunus avium) using sucrose/xylitol solutions and a staining technique utilising erythrosine and red gardenia at varying concentrations (119, 238 and 357 ppm) and temperatures (40, 50 and 60 °C). Given the fruit's epidermis resistance, the effective diffusivities of skin were inferior to those in flesh. Temperature and concentration synergise in enhancing diffusion coefficients and dye penetration within the food matrix (357 ppm and 60 °C). Red gardenia displayed significant temperature-dependent variation (p = 0.001), whereas erythrosine dye remained stable by temperature changes (p > 0.05). Gardenia's effective diffusivities in cherry flesh and skin, at 357 ppm and 60 °C, 3.89E−08 and 6.61E−09 m2/s, respectively, significantly differed from those obtained at lower temperatures and concentrations. The results highlight the temperature-concentration impacts on mass transfer calculations for food colouring processes and preservation methodologies.


Statistical analysis of diffusion coefficients: influence of concentration and temperature
The subsequent information summarises the average effective diffusion coefficients of erythrosine and red gardenia dyes in cherry skin (D S ) and flesh (D F ) during the initial hour of the colouration process, as depicted in Table 1.Statistical parameters, namely, p-values, determination coefficients (R 2 ), root mean square error (RMSE) and chi-square values (χ 2 ) have been included to provide an indication of the uncertainty inherent in the mathematical model.The preliminary phase of the experiment (60 min) was chosen based on the primary molecular movement of dye species that occurred within this time frame before the system became saturated and stabilised, leading to significant deceleration in all diffusive transport (Discussion).

Discussion
It can be assumed that the diffusion of both dyes exhibited enhancement upon escalation of temperature, leading to higher dye concentrations 41 .Moreover, the flow-out of colourants from the fruit followed the same pattern; however, the pH level was maintained between 4.2 and 4.8 within the fruit to induce minimal precipitation of the colourant within the matrix, resulted in lower dye outlet values than their income (Fig. 1).Furthermore, it is deduced that no sooner had the pigment exit process initiated than the matrix was entirely saturated with sugars and dye.Consequently, the tortuous network of internal canaliculi in cherries may significantly impede the diffusion of dyes, causing a noticeable decrease in the slope of the concentration curve for both the entry and exit of pigments.Hence, this indicates that the driving force decreased progressively as the process continued.www.nature.com/scientificreports/Upon examination of the initial sample, irregularities were identified in the redness values, signifying the commencement of the pigment penetration phenomenon.The non-uniformity of initial diffusion throughout the fruit was attributed to the inherent intricacy of biological matrices, resulting lack of uniformity in dye diffusion into the fruit's interior.Consequently, only a minute quantity of dye was extracted upon reaching equilibrium, as evidenced by the minimal dye concentrations in the output curve.This observation persisted until shortly before longer staining periods, typically less than 60 to 70 min.However, in the case of extended trial durations for final samples, the redness stabilised, indicating an enhancement in colour uniformity, and the amount of dye extracted from the cherry approached an asymptote.An analysis of the kinetics of dye entry indicated complete diffusion of the dye throughout the fruit.This suggests that the pigment no longer diffuses within the sample, also signifying matrix saturation with sugars.www.nature.com/scientificreports/On the one hand, it is observed that the concentration profiles at 238 ppm (Fig. 1g-l) were analogous to those obtained in an experiment conducted at 119 ppm (Fig. 1a-f), concerning concentration variations with temperature and the curves' behaviour at the beginning and end of the trial.Additionally, the study discloses that the levels of erythrosine and red gardenia concentrations were significantly higher than in the previous research conducted at 119 ppm, attributable to the present study employing a higher concentration of colourant.Noticeably, the dye input and output concentration values were more than double those obtained at 119 ppm despite the dye concentration being twice as high as that used in the previous trial (Fig. 1a-l).
It is also revealed that the concentration profiles at 357 ppm (Fig. 1m-r) were commensurate with the results obtained in experiments conducted at 119 and 238 ppm in terms of the concentration variations with temperature and the behaviour of the curves at the start and end of the experiment.Moreover, the input and output concentrations of red gardenia and erythrosine within the matrix reached levels that were superior to those obtained at 119 and 238 ppm, attributable to the use of a greater concentration of dye.Notably, the concentration used was three times that of the trial carried out at 119 ppm (Fig. 1a-f and m-r), and yet, the concentration values that entered and were emitted were larger than triple.Therefore, it can be inferred that an increase in temperature has a significant impact when greater dye concentrations are employed in the staining process 42,43 .
On the other hand, given that colourant precipitation was compelled within the cellular tissue of the cherry, coupled with the resistance to the transfer of species offered by the cherry's skin 44 , it is deemed to assume that it is retained within the fruit.As a result, the entry diffusion of dyes should be quite accessible when there is no saturation, compared to the resistance to diffusion offered when the dye exit experiments were conducted, given that these phenomena would be coinciding.Finally, the concentration values generated by the model were duly adjusted, leading to determination coefficients R 2 exceeding 99% in all instances and minimum chi-square values.
The following discussion is centred on investigating the effective diffusion coefficients of erythrosine and red gardenia dyes, with the objective of understanding the diffusion process involved in fruit colouring (Fig. 2).It is revealed that the driving force behind the diffusion is at its highest at the initial stages of the experiment when the concentration differential between the interior and exterior of the cherry is at its maximum.However, as the process advances, this fruit's differential concentration decreases, directing to a reduction in the driving force and a subsequent decrease in the coefficients 45 .Additionally, the accumulation of sugars and dye in the interior of the fruit results in saturation, leading to a decrease in the concentration differential of the fruit.
In contrast, when the system began to saturate, and the internal tortuosity of the fruit increased, both curves stabilised after the first 60 min.The effective diffusion coefficients were found to be smaller, measuring 8.72E−12, 1.17E−11, and 2.70E−11 m 2 /s at 40, 50, and 60 °C, respectively (Fig. 2e).On the other hand, in cherry skin (Fig. 2f), the coefficients were found to be 1.48E−12, 1.99E−12, and 4.59E−12 m 2 /s at 40, 50, and 60 °C.As for red gardenia in cherry flesh (Fig. 2g), the coefficients were 7.61E−13, 1.23E−12, and 2.36E−12 m 2 /s at 40, 50, and 60 °C, whereas in skin (Fig. 2h), are calculated 4.48E−13, 7.22E−13, and 7.51E−13 m 2 /s at 40, 50, and 60 °C.It is observed that coefficients for red gardenia are significantly lower than those for erythrosine at advanced colouring times, possibly indicating that gardenia diffuses at a faster rate initially, leading to intense matrix saturation; hence, lower coefficients are obtained.On the contrary, erythrosine diffuses slower, resulting in higher coefficients under the same conditions.At these instances no significant differences were appreciated, the concentration curve was the most stable when values were the highest.The findings also revealed that the red gardenia had more substantial effective diffusion coefficients, one order of magnitude greater in both cherry skin and flesh, with the main molecular movement of species in the system occurring up to approximately 40 minutes 47 .Contrary to erythrosine, the phenomenon stabilised after about 60 min, possibly due to the smaller size of the red gardenia molecule compared to erythrosine 48 .Furthermore, it was observed that the effective diffusion coefficients in cherry skin were one and up to two orders of magnitude lower than those obtained in cherry flesh (Fig. 2a-h).This suggests that the fruit epidermis presents a barrier effect to the diffusion of molecules 44 , as previously mentioned.The epidermis is composed of more extensive and tighter cells than that of the parenchyma, which are more closely arranged.This characteristic of the epidermis, coupled with the cuticle layer, presents a barrier effect to the diffusion of substances that differs from the diffusion in the mesocarp.
An investigation conducted by Silva et al. 49 employed a convective-type boundary condition to model both pure diffusive transport and convective phenomena.The study underscored the presence of external resistance to mass transfer at low stirring frequencies in the extraction process of anthocyanin dye from jambolan (Syzygium cumini (L.)).Similarly, our current work introduces a method for computing effective diffusivities and concentration profiles in cherries (Prunus avium), assuming purely diffusive transport and disregarding external resistance to mass transfer.The advocated boundary condition (Eq.5) in our study is deemed appropriate, given a large Biot (Bi) number at a high stirring frequency of 220 rpm, with the sole variable necessitating determination being the effective mass diffusivity.Notwithstanding, it is our intent to investigate convective boundary conditions in future work to elucidate the transport mechanism of substances at low stirring velocities.
Reiterating, the trial results indicate that the rate of species transfer phenomena is chiefly determined by the combination of temperature and concentration.It was observed that the diffusion coefficients were considerably www.nature.com/scientificreports/superior at 357 ppm (Fig. 2i-l) than those obtained at 119 and 238 ppm dye concentrations.Additionally, it was observed that the evolution of the dye input and output curves concurred with the changes noted in the effective diffusion coefficients, further corroborating the higher coefficients at the experiment's commencement and lower coefficients at its conclusion, as previously discussed.
As stated earlier, it was noted that the effective diffusion coefficients in the skin, both in erythrosine and red gardenia, were inferior by one to two orders of magnitude to those obtained in cherry flesh because of the resistance offered by the fruit's epidermis.Additionally, the diffusion coefficients noted at 357 ppm were between three and four orders of magnitude greater than those obtained at 119 and 238 ppm, within the initial hour of commencing the colouring, ranging from 3.89E−08 to 6.61E−09 m 2 /s for red gardenia and 6.96E−10 to 1.18E−10 m 2 /s for erythrosine, in flesh and skin, respectively (Table 1).Our results are in agreement with the results reported by Kian-Pour N. 34 , which showed as the drying temperature of pretreated fresh green almonds in starch solution increased from 70℃ to 110℃, the diffusion coefficient increased from 3.502E−9 m 2 /s to 6.434E−9 m 2 /s.
The effective diffusivities in food tissues, particularly those obtained by Salehi et al. 31,50 are comparable to the latter mentioned in the work.The values for water in apple slices flesh range from 1.48E10-10 to 4.62E10-10 m 2 /s, whilst in kiwi slices flesh, they range from 9.05E10-11 to 2.93E10-10 m 2 /s.These diffusivities are akin to those obtained with erythrosine.In an investigation conducted by Pezo et al. 51 the osmotic dehydration process was examined across various sweet potato cultivars utilising sugar beet molasses.The study revealed effective moisture diffusivity values ranging from 1.85E − 08 to 4.83E − 08 m 2 /s.Additionally, Khoualdia et al. 52 determined average effective diffusion coefficients for water loss and solid gain during the osmotic dehydration of Tunisian pomegranate arils in sucrose osmotic solution, yielding values of 8.30E − 09 and 4.60E − 09 m 2 /s, respectively.These findings are consistent with those observed with red gardenia.
According to the analysis, the observed diffusion coefficients in the skin and flesh are also consistent with the calculated values by da Conceição Silva et al. 53 , which span from 1.00E−12 m 2 /s to 1.00E−08 m 2 /s, respectively.Therefore, it can be concluded that concentration plays the most significant role in the diffusive transport of species, which can be optimised by temperature to generate a synergistic effect.
On the other hand, utilising surface plots 54 as a function of the parameter a* concerning time and radial distance within the cherry at 40, 50, and 60 °C, it is depicted in Fig. 3 the concentration profiles of erythrosine and gardenia red at 119, 238 and 357 ppm (Methods).The profiles indicate that the diffusion of both dyes is progressive concerning the internal radius and time, with higher redness values appearing in the periphery.By implementing the Robin condition, Eq. ( 6), the double diffusion boundary could be evidenced by penetration of the dyes at the flesh-skin interface due to major redness values obtained at the cherry's skin (Fig. 3a-r).Furthermore, superior values of the redness parameter, a*, were attained at 60 °C, whilst inferior values were obtained at 40 °C in both dyes, thereby visualising the temperature-accelerating effect in the staining process within the cherry 55 .
Moreover, it can be observed that the natural dye, red gardenia, demonstrated a greater redness than erythrosine at similar impregnation times, indicating a faster diffusion rate.This observation could be attributed to the smaller size and molecular weight of the natural red gardenia dye (388.37 g/mol) compared to that of the artificial dye erythrosine (879.86 g/mol) 48 , as mentioned earlier.
The behaviour observed at 238 ppm (Fig. 3g-l) was similar to that obtained at 119 ppm (Fig. 3a-f), where the highest redness values were noticed at the flesh-skin interface, approximately 12 mm, measured from where the flesh begins.Notably, the double diffusion boundary of dye species in the skin was also verified 43 , Robin boundary condition, given that the skin resists the transfer of species while allowing the passage of a smaller flow of colouring inside the fruit, in addition to the primary flow that occurs through the flesh.The progressive increase in redness as the staining phenomenon progressed and the dye entered the matrix was also observed; therefore, the surface graphs would assertively illustrate the diffusive physical phenomenon.
Furthermore, the redness values were higher than those obtained at 119 ppm, indicating that the temperature and the concentration provide a synergistic effect by notably increasing the dye concentration, diffusion coefficients, and redness within the fruit (Fig. 3a-f and g-l).On the other hand, considering the variation profile of redness for the red gardenia dye values higher than those of the erythrosine dye were also obtained, justified by what was previously discussed.
Regarding the results obtained from the experimentation at 357 ppm (Fig. 3m-r) respecting 119 (Fig. 3a-f) and 238 ppm (Fig. 3g-l), the study findings successfully reproduced all the observed phenomena, including acquiring redness parameter profiles of erythrosine and red gardenia.As discussed earlier, the trial outcomes revealed significant insights into the mass transfer of erythrosine and red gardenia within a food matrix.Specifically, the study found that the skin of the food matrix acted as a double boundary diffusion for dye species.The highest redness values were observed at the flesh-skin interface, indicating a considerable interaction between the dyes and the food matrix.It was further identified that the diffusion coefficients for red gardenia dye were higher than those for erythrosine, suggesting an increased tendency for the former to move within the food matrix.
The optimal conditions for mass transfer of erythrosine and red gardenia within a food matrix impregnated with sucrose and xylitol were 357 ppm and 60°C 56 .These conditions enhanced all quantification parameters involved in the present study based on the concentration ranges and temperatures used.
On the other hand, a summary of the average effective diffusion coefficients of the dyes erythrosine and red gardenia in cherry skin (D S ) and flesh (D F ) during the initial 60-min period of the colouring process is presented in Table 1.Additionally, statistical parameters such as p-values, determination coefficients (R 2 ), root mean square error (RMSE), and chi-square values (χ 2 ) are provided to indicate the uncertainty associated with the mathematical model.The results indicate a good fit, with coefficients of determination above 99.5% for certain experiments, and above 99% for all cases.Chi-square values were optimised to minimise the associated uncertainty, and the obtained RMSE values were also minimised through the adjustment of the analytical model using the least squares and minimum chi-square methods.Furthermore, high stirring frequencies (220 rpm) led to a large www.nature.com/scientificreports/Biot number case, resulting in decreased resistance to mass flow in the boundary skin-hypertonic solution 49 .
Consequently, it can be inferred that the cherry skin adopts the dye concentration of the sweetening solution.
The preliminary phase of the experiment was designated based on the principal molecular movement of dye species that takes place within this time frame prior to the system reaching saturation and stability, leading to a significant deceleration in all diffusive transport.
The results indicate that temperature and concentration have a combined influence in enhancing diffusion coefficients and dye penetration within the food matrix.Even minute variations in any of these factors can impact dye mass transfer 57 .Whereas calculated diffusivities for the erythrosine dye were higher at superior temperatures and concentrations, the differences were not statistically significant (p > 0.05), indicating this dye's stability against temperature changes.On the other hand, significant differences (p < 0.05) were observed in the calculations obtained with red gardenia when varying the temperature.
The diffusion coefficients obtained at 357 ppm and 60 °C in cherry flesh (p = 0.001) and skin (p = 0.002) were significantly different from those obtained at 40 and 50 °C, as well as those calculated in skin and flesh of cherries coloured with erythrosine at 119, 238 and 357 ppm and 40, 50 and 60 °C.This might indicate the role of temperature variation in accelerating the colouring process with this pigment, provided that concentration values of 357 ppm or higher are used.

Concluding remarks
An analysis of numerical and analytical solutions of the diffusion equation via surface analysis and diffusivity calculation in biological media is presented.The study revealed that the interplay of temperature and concentration influences diffusion coefficients and dye penetration within the food matrix.It can be concluded that the diffusion rate of the natural red gardenia dye is faster compared to that of the artificial dye erythrosine.The diffusion coefficients for the red gardenia dye at 357 ppm, 3.89E−08 to 6.61E−09 m 2 /s and 6.96E−10 to 3.46E−11 m 2 /s for erythrosine, in flesh and skin, respectively, were between two and three orders of magnitude greater than those for erythrosine, indicating an increased tendency for the former to move within the food matrix, possibly due to its smaller size and molecular weight.The study revealed that temperature and concentration have a combined influence in enhancing diffusivity and dye penetration within the food matrix.Even minute variations in any of these factors can impact dye mass transfer.The optimal conditions for mass transfer of both dyes within a food matrix impregnated with sucrose and xylitol were identified as 357 ppm and 60 °C.
Furthermore, the study provided insights into the process of dye diffusion, including the diffusion rate, the distance covered, and the time to diffuse, which will be pivotal in optimising the dyeing process and elevating the quality of cherry products.The research aims to improve the efficiency and quality of products coloured with such dyes by providing an understanding of the dye diffusion process and discussing the usage of plant-based dyes and synthetic dyes in the food industry.These findings bear implications for the food industry, particularly in the realm of natural food production processes and the utilisation of plant-based dyes.Comprehension of temperature and concentration's impact on diffusion coefficients presents an opportunity to enhance the efficiency and sustainability of food colouring processes, aligning with the escalating consumer demand for natural and organic products.

Materials
Firstly, a batch of 10 kg of Prunus avium cultivar Bing was procured from Luján de Cuyo, Mayor Drummond, Mendoza, Argentina (coordinates in decimal degrees: − 33.00443364309908; − 68.86583423899584).Lactitol powder (DuPont Corporation, Wilmington, Delaware, USA), Maltitol powder (Shandong Lujian Biological Technology Co. Ltd, China), Xylitol powder (Shandong Lujian Biological Technology Co. Ltd, China) and combinations, as well as Erythrosine powder dye (Macsen Labs, N.K Agrawal Group, India) and Red Gardenia powder dye (Omya Inc., Cincinnati, Ohio, USA) were used in this study.The cherries were carefully calibrated (27 mm), pitted and desulphited (sulphur anhydride at 1500 ppm) by immersing them in tap water baths at room temperature for 24 h, with water renewal every 4 h, as illustrated in Fig. 4a.

Methods
Fruits were plunged into sugary hypertonic solutions of low primary concentration (25 Bx).Subsequently, the concentration of the solution was systematically augmented by 10 Bx daily until it reached a final concentration of 65 Bx.This process was devised to attain the desired concentration of 55 Bx within the fruit (Slow method).
It is important to note that the staining process was executed when the concentration of the hypertonic solution reached 35 Bx.After reaching this specific concentration level, the matrix was left to rest in the solution for 24 h before proceeding with the following impregnation process.This process was repeated after each increase in the concentration of the sweetening solution until the desired concentration of 55 Bx was ultimately achieved in order to obtain candied cherries.Statement for plant material: our study complies with relevant institutional, national, and international guidelines and legislation.
Prior to initiating the impregnation process in sweetener solutions, 18 formulations were prepared.These formulations were constituted by sucrose and polyols, such as lactitol, maltitol, and xylitol, and combinations, as previously mentioned.The concentration of solutions was selected according to Maldonado et al. 58 , by dissolving the correct amount of polyols in distilled water using a stable temperature magnetic stirrer (model PIOWAY 78HW-1, BioSmartest, Norces, Argentina) at 60 °C and 220 rpm to achieve a total or partial substitution of sucrose in solution (Table 2) and (Fig. 4b).These formulations were replicated to ensure the reproducibility of the test results, thereby confirming that crystallization did not occur in the selected formulation.These were as follows: A combination of sucrose and xylitol was the formulation utilised for candying the cherries, aiming to perform a partial replacement of table sugar 59 , thus obtaining a sweetening solution containing sucrose -xylitol 50% (w/V) 60 , since its mixture in these proportions did not generate the formation of precipitate or crystals during six months of storage at room temperature of 20 ± 2°C 61 .

Impregnations and staining process
The candying process was initiated through the employment of a multiple impregnation method, commonly referred to as the "French or Slow Method," as per the methodology proposed by Maldonado and González Pacheco 62 .The initial stage involves boiling and cooling a sweetener solution with a concentration of 25 Bx (first impregnation) to approximately 50 °C to prevent the occurrence of plasmolysis and the development of wrinkles in the fruit.Subsequently, the cherries were introduced into a 35 Bx syrup (second impregnation) under identical conditions to those of the preceding day.During this procedure, erythrosine and red gardenia were added at 119, 238 and 357 ppm to stain the fruits and observe their influence on concentration.The solution is maintained at a steady temperature of 40, 50, and 60 °C and subjected to constant agitation through a thermostatic magnetic heating stirrer PIOWAY 78 HW-1 at 220 rpm (Fig. 4c), ensuring the solution's homogeneity.
To regulate the pH of the sweetening solution, the integration of 0.9 mL of 10% (w/V) citric acid or 0.3 mL of 10% (w/V) NaHCO 3 was implemented 63 .This measure facilitates the maintenance of a pH range between 4.2 and 4.8, which induces slight precipitation of the pigment within the cellular tissue of the cherry and enhances the fruit's vivid and visually appealing hues 64 .

Sampling
Two cherry samples were randomly selected from multiple container zones, as depicted in Fig. 4d.These samples' cross-sections were acquired with a scalpel's assistance, and the parameters L, a*, and b* of the colour space were subsequently measured 65 .The luminosity (L), redness or greenness (a*), and blueness or yellowness (b*) (referred to in combination as CIELAB) were measured at three specific points, namely 2.63 mm, 5.26 mm, and 10.53 mm on average, calculated from the centre of the cherry, using a Konica Minolta CR-400 colourimeter and an illuminant D65 (natural light).These measurements were taken from where the flesh begins, as illustrated in Fig. 4e.Additionally, a whole cherry was used to measure the same parameters on the outside to discern the colouring progress during the diffusion of the pigments.
Furthermore, a mathematical proposition was later formulated concerning these dye species' diffusion phenomenon with a double diffusion boundary.Therefore, it was imperative to extract cherry samples and preserve them in the same original hypertonic solution (without dye) to determine the output of these species across concentration gradients (Fig. 5).By introducing 0.9 ml of 10% (w/V) citric acid or 0.3 ml of 10% (w/V) NaHCO 3 to the cherry, as previously mentioned, a pH range of 4.2 to 4.8 was achieved, halting dye release as the dye precipitated within the cellular tissue of the fruit.This method allows for the containment of dye within the fruit's matrix during the colouring stage, thus facilitating the kinetics of dye entry.Manipulating the pH within this specific range represents a significant technological advancement, particularly in preventing cocktail cherries from staining neighbouring fruits with colouration.Table 2. Formulations of sucrose and polyalcohol solutions prepared for candying cherries.Where "form" 1,2,3 up to 18 was the notation employed to name the eighteen formulations of sweetening solutions.www.nature.com/scientificreports/Conversely, to determine the kinetics of dye output, 1 ml of 10% (w/V) NaHCO3 was added to raise the pH between 5.5 and 6.This was conducted in the original hypertonic solution of 35 Bx of 50% xylitol-50% sucrose without dye, thereby recreating the initial conditions prior to the colouring process.Under these conditions, the equilibrium of dye concentrations inside the cherry and the sweetening solution was achieved after approximately 24 h at room temperature of 20 ± 2 °C (Fig. 6).
In the initial stages of the experiment, it was determined that the initial sample size for assessing the cherries should exceed triplicate due to the variability in external cherry colour (n = 5).This decision stemmed from the inherent complexity of biological matrices, highlighting the non-uniform diffusion of dyes within the intricate tissue matrix.However, as the experiment progressed and the cherries underwent dyeing, there was a noticeable enhancement in colour uniformity, reflected in closely clustered redness values and the resultant vivid red pigmentation of the fruit (Fig. 4d).Consequently, a decision was made to reduce the sample size to three measurements (n = 3).
The solutions were measured in a Perkin Elmer Lambda 35 UV-VIS spectrophotometer at 530 nm 66 , and the measurements were carried out in triplicate.Moreover, an analysis was conducted to examine the impact of concentration and temperature on the ingress and egress kinetics of dyes within the fruit during the candying process.The assessment also encompassed an inquiry into the effective diffusivity of the dye within the fruit's skin and flesh.Additionally, numerical resolutions were determined to visually represent the penetration phenomena and associated concentration profiles at varying temperatures and presence of dye during the progressive advancement of the dye diffusion process within the biological medium, as depicted in the schematic diagram featured in Fig. 6.

Mathematical modelling
The experimental data underwent mathematical analysis during the colouring and impregnation or osmotic dehydration process in sweetened solutions.This process involved the adjustment to a differential equation, which governs the molecular diffusion through the cherry matrix regarded as a solid porous hollow sphere.
Theory.Considering the transfer of species, the equation of the Reynolds transport theorem was utilised.Assuming the total molar concentration of the binary mixture constant and independent diffusion coefficients to spatial coordinates, the equation can be simplified and expressed tensorly, Eq. (1), as follows 67 .
where C i is the molar concentration of species i in the binary mixture, D ij is the effective diffusion coefficient for a binary system, v * is the local average molar velocity of the mixture, the production rate of the species i or j per unit volume due to chemical reactions are denoted by R i or R j , and t is time.
Thus, the dimensionless, one-dimensional diffusion equation, with constant effective coefficients in the flesh (D F ) and skin (D S ), considering only the molecular diffusion of dyes as the transport mechanism within the fruit, while disregarding the generation term of substances through chemical reactions, can be regarded as a partial differential equation, Eq. ( 2), as follows [68][69][70] : (1) Note that theta, , is a non-dimensional time, R is a non-dimensional radius, C is the non-dimensional con- centration, C (t) is the dye concentration within the cherry's flesh as time progressed, C s the dye concentration in the cherry's skin in contact with the sweetening solution 71 , and C i the dye concentration within the cherry's flesh, at the beginning of the experiment.
It was deemed appropriate to assume that the accumulation of solutes in the skin, represented by r S − r O , and accordingly the resistance to species transfer, was insignificant in comparison to the flux through the porous surface and the flux itself, given by the cherry skin thickness of 0.0004 m.The cherries' flesh was considered homogeneous and isotropic, and the diffusion process exhibited radial symmetry with unidirectional diffusion.Due to the great agitation of the sweetener solution surrounding the internal and external surfaces, the concentration in these areas immediately acquires the concentration of the liquid.Furthermore, the epidermis's thickness was much smaller than the radii of the inner and outer faces.Thus, the difference in surface areas could be disregarded, and the thickness assumed as r S − r O (Fig. 7).It should be noted that despite creating 18 distinct sweetening formulations, the cherries are exclusively immersed in the hypertonic sucrose-xylitol solution for the candying process.
Calculation.An alternative version of Eq. ( 2) can be obtained by fitting the redness parameter, a*, using the least squares method with a straight-line approach, compared to the current erythrosine or red gardenia dye concentration, Eq. ( 3), thereby establishing a correlation that enabled the experimental data to be fitted to the general equation governing species transport. ( (3) where Note that A , is a non-dimensional radius, given by the relation between r A and r 0 , a * (t) is the redness within the cherry's flesh as time progressed, a * s the redness in the cherry's skin in contact with the sweetening solution, and a * i the redness within the cherry's flesh, at the beginning of the experiment.Then, an infinite series can be expressed, Eq. ( 7), representing the evolution of the dimensionless volumetric parameter a * V(�) in relation to dimensionless time Θ, modified to that presented by Maldonado and González Pacheco 48 .
To determine the effective diffusion coefficients and eigenvalues n , an iterative nonlinear regression method was employed using the least squares method in conjunction with GraphPad PRISM © Software (V9.5.1, MA, USA).For a large mass transfer Biot number (given conditions mentioned earlier) corresponding to the specified boundary condition, Eq. ( 5), considerable truncation errors may arise, particularly during the initial stages of the process.Nonlinear regression relying on a limited number of terms in the series of analytical solutions for determining effective diffusivity is deemed unsuitable for achieving precise results.Consequently, the first 220 terms of the analytical solution of the diffusion equation for spherical geometry were incorporated alongside the optimiser 49,72 .
Regarding further details of the mathematical description, see Supplementary Information.

Statistical analysis
In light of the unequal sample sizes, a Tukey-Kramer HSD multiple comparisons test, along with the Scheffe test, was implemented.Additionally, we applied the minimum chi-square method to determine diffusivity and model fits 49,72 .Statistical significance was determined by a p-value less than 0.05 in the ANOVA analysis, using IBM Ⓡ SPSS Ⓡ Statistics software (V22.0,IBM Ⓡ Co., NY, USA) to determine significant differences in the mean of the coefficients.The results are presented as mean ± standard deviation (SD).www.nature.com/scientificreports/Numerical solution Aiming to predict the concentration profiles and visualise the gradual entrance of both dyes, the MATLAB® R2017a software (V9.2,The MathWorks Inc., MA, USA) was employed.The latter was configured using the MATLAB® PDE Solver, based on the assumption of spherical coordinates with azimuthal and zenith angular symmetries to adjust the expression, Eq. ( 3), to Dirichlet boundary conditions, Eqs. ( 4) and ( 5), and Robin condition or mixed boundary condition, Eq. ( 6), by fitting a hollow sphere model featuring a double diffusion boundary at the cherry flesh-skin interface.The problem was solved numerically using the finite element method.A mesh with 15 equally spaced points was utilised in the spatial interval [0,12].The time interval was [0,60], considering the primary movement that occurs during the initial stages of the process (Discussion).The solver encodes the coefficients for PDEs (partial differential equations) of the form, Eq. ( 8): The terms included in the equation are: The variable m is utilised to indicate the three possible symmetry types for an object, namely slab, cylindrical, or spherical symmetry.These classifications are assigned the values of 0, 1, or 2, respectively.In the current context, it has been established that the value of m is equal to 2.
The coupling of partial derivatives concerning time is subject to the restriction of being multiplicatively tied to a diagonal matrix c x, t, u, ∂u ∂x , whose diagonal entries are either zero or positive.A diagonal entry of zero indicates an elliptic equation, whereas all other entries correspond to parabolic equations, with at least one parabolic equation being mandatory.Furthermore, a diagonal entry of c corresponding to a parabolic equation can vanish at isolated x values, provided that those x values are mesh points.
The components of the solution, as articulated in Eq. ( 8), are in accordance with boundary conditions of the form, as specified in Eq. ( 9): The matrix q(x, t) comprises diagonal elements that are either zero or always non-zero.It is noteworthy that the boundary conditions are expressed in terms of the flux f, rather than the partial derivative of u with respect to x.Additionally, among the two coefficients p(x, t, u) and q(x, t) , only p is dependent on u.

Statement for plant material
The study complies with relevant institutional, national, and international guidelines and legislation.(9) p(x, t, u) + q(x, t)f x, t, u, ∂u ∂x = 0

Figure 1 .
Figure 1.(a-r) Time-dependent variations in input (in) and output (out) concentrations of erythrosine (E) and red gardenia (RG) dyes at 119, 238, and 357 ppm, and temperatures of 40, 50, and 60 °C, fitted to the analytical model using 220 terms of the infinite series.The concentration values obtained through the hollow sphere model were adjusted, resulting in determination coefficients R 2 greater than 99% and minimum chi-square values in all cases.

Figure 2 .
Figure 2. (a-l) Time-dependent evolution of effective diffusion coefficients for erythrosine (E) and red gardenia (RG) dyes in cherry skin (D S ) and flesh (D F ) at 119, 238 and 357 ppm and 40, 50, and 60 °C.

Figure 4 .
Figure 4. (a-e) Desulphited cherries after 24 h in water baths (a).Illustration of the formulations prepared constituted by sucrose and polyol solutions (b).Cherry staining trials by varying temperature, dyes, and concentration (c).Sample of cherries regularly extracted prior to measuring the L, a, and b parameters of the CIELAB colour space (d).Spacing of triplicate sampling of L, a, and b parameters of the CIELAB colour space in cherries (e).

Figure 5 .
Figure 5. Cherry samples collected to measure dye output by UV-VIS spectrophotometry.

Figure 6 .
Figure 6.Schematic diagram delineating the process of cherry colouration, encompassing the following steps: sample collection, colour analysis, UV/VIS spectrophotometry, determination of effective diffusivities, dye input and output kinetics, as well as the generation of surface graphs and concentration profiles within the fruit.Created with BioRender.com(publishing license: IJ26X22SH1).

( 4 )Figure 7 .
Figure 7. Schematic representation of the internal radii of the cherry and an enlargement of the epidermis zone and its surrounding area, presenting the formation of a double diffusion boundary.The visualisation illustrates a simple model of the dye input flowing through the flesh and the cherry skin.Created with BioRender.com(publishing license: KB26TRPPY7).

Table 1 .
Average effective diffusion coefficients of erythrosine and red gardenia dyes in cherry skin (D S ) and flesh (D F ) for the first 60 min after starting the colouring process at concentrations of 119, 238 and 357 ppm and 40, 50 and 60 °C, along with statistical parameters provided to indicate the uncertainty associated with the mathematical model.†Effective diffusion coefficients in flesh (D F ) and skin (D S ) are presented as means ± SD.